<template>
  <p>Child:msg {{ msg }}</p>
  <input type="text" @input="onInput" />
</template>

<script>
import { defineComponent } from "vue";
export default defineComponent({
  props: ["msg"],
  emits: ["update:msg"],
  setup(props, { emit }) {
    function onInput(evt) {
      emit("update:msg", evt.target.value);
    }
    return {
      onInput,
    };
  },
});
</script>

<style lang="less" scoped>
</style>